	<?php
		$name=$_POST['username'];
		$pwd=$_POST['userpwd'];
		
		//链接数据库
		$conn=mysqli_connect('localhost','root','root','mydate');
		//设置链接过程中存取数据的编码
		mysqli_query($conn,"set charset 'utf8'");
		mysqli_query($conn,"set character set 'utf8'");
	
		//编写sql语句
		$sql="select * from dates where name='$name' and pwd='$pwd'";
		$res=mysqli_query($conn,$sql);
		
		$count=mysqli_num_rows($res);
		if($count > 0){
			echo json_encode(array(
				"code" => 200,
				"body" => array(
					"msg" => "添加成功"
				)
			));
		}else{
			echo json_encode(array(
				"code" => 201,
				"body" => array(
					"msg" => "添加失败"
				)
			));
		}
		
	?>